﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SortOf
{
    static class SequentialSearch
    {
        public static int SeqSearch(List<IComparable> list, IComparable value)
        {
            for (int index = 0; index < list.Count; index++)
            {
                if (list[index].CompareTo(value) == 0)
                {
                    return index;
                }
            }
            return -1;
        }

        public static void Delete(List<IComparable> list, IComparable value)
        {
            int index = SeqSearch(list, value);

            if (index != -1)
            {
                list.RemoveAt(index);
            }
        }
    }
}
